<!--
/**
 * moOde audio player (C) 2014 Tim Curtis
 * http://moodeaudio.org
 *
 * tsunamp player ui (C) 2013 Andrea Coiutti & Simone De Gregori
 * http://www.tsunamp.com
 *
 * This Program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 3, or (at your option)
 * any later version.
 *
 * This Program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * 汉化： Androidnews
 */
-->
<div id="container">
<div class="container">
    <h1 class="snd-config">MPD</h1>

    <form class="form-horizontal" action="" method="post">
        <legend>设置
			<button class="legend-config btn btn-medium btn-primary btn-submit" type="submit" name="save" value="1" $_save_disabled>保存</button>
		</legend>
		<p class="sub-legend">
			当蓝牙控制中的音频输出设置为“蓝牙扬声器”或多房间发送器或接收器打开时，无法保存MPD设置。
		</p>

		<div class="control-group">

            <div class="config-horiz-rule">DSD支持</div>

            <label class="control-label" for="dsd-usb">格式</label>
            <div class="controls">
				<select id="dsd-usb" name="conf[dop]" class="config-select-large">
					$_mpd_select[dop]
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-dsd-audio" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-dsd-audio" class="config-help-info">
					<b>Native DSD:</b>&nbsp;如果音频设备报告它支持原生DSD，则MPD将把未改变的DSD比特流发送到设备，否则MPD将执行DSD到PCM的即时转换。<br>
					<b>DSD over PCM (DoP):</b>&nbsp;无法检测音频设备是否支持DoP，因此只有在您确信设备支持DoP的情况下才能启用此功能，否则封装的DSD比特流可能会导致巨大或不可预测的失真。
                </span>
            </div>

            <label class="control-label" for="stop_dsd_silence">停止前静音</label>
            <div class="controls">
				<select id="stop_dsd_silence" name="conf[stop_dsd_silence]" class="config-select-large">
					$_mpd_select[stop_dsd_silence]
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info_stop_dsd_silence" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info_stop_dsd_silence" class="config-help-info">
					在手动停止或暂停DSD/DoP播放之前播放器静音。这是某些音频设备在停止播放DSD/DoP时发出噪音的一种解决方法。
				</span>
            </div>

			<label class="control-label" for="thesycon_dsd_workaround">Thesycon补丁</label>
            <div class="controls">
				<select id="thesycon_dsd_workaround" name="conf[thesycon_dsd_workaround]" class="config-select-large">
					$_mpd_select[thesycon_dsd_workaround]
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info_thesycon_dsd_workaround" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info_thesycon_dsd_workaround" class="config-help-info">
					为Thesycon USB音频接收器中的错误启用解决方法。在这些设备上，播放DSD512或PCM会导致所有后续播放其他DSD速率的尝试失败，这可以通过以44.1 kHz短暂播放PCM来解决。
				</span>
            </div>

            <div class="config-horiz-rule">SoX重新采样</div>

			<label class="control-label" for="sox-enabled">启用</label>
            <div class="controls">
                <select id="sox-enabled" name="sox_enabled" class="config-select-large">
					$_mpd_select[sox_enabled]
                </select>
                <span class="config-help-static">
                    启用SoX并指定采样速率时，将出现选择性重采样选项。
                </span>
            </div>

			<label class="control-label" for="sox-bit-depth">比特深度</label>
            <div class="controls">
                <select id="sox-bit-depth" name="sox_bit_depth" class="config-select-large">
					$_mpd_select[sox_bit_depth]
                </select>
            </div>

            <label class="control-label" for="sox-sample-rate">采样率(kHz)</label>
            <div class="controls">
                <select id="sox-sample-rate" name="sox_sample_rate" class="config-select-large">
					$_mpd_select[sox_sample_rate]
                </select>
            </div>

            <label class="control-label" for="sox-channels">通道</label>
            <div class="controls">
                <select id="sox-channels" name="sox_channels" class="config-select-large">
					$_mpd_select[sox_channels]
                </select>
            </div>

    		<div class="$_selective_resampling_hide"> 
				<!-- This is ment to control visibility of the feature in case MPD no longer supports the patch -->
    			<div id="selective_resample" class="hide">
	                <label class="control-label" for="selective_resample_mode">选择性重新采样</label>
	                <div class="controls">
	                    <select id="selective_resample_mode" name="conf[selective_resample_mode]" class="config-select-large">
							$_mpd_select[selective_resample_mode]
	                    </select>
						<a aria-label="Help" class="config-info-toggle" data-cmd="info_selective_resample_mode" href="#notarget"><i class="fas fa-info-circle"></i></a>
                        $_selective_mode_selected
						<span id="info_selective_resample_mode" class="config-help-info">
							<p>这些图表显示了示例目标速率的选择性重采样模式的效果。</p>
							<img src="images/Selective resampling chart 1.jpg" alt="Selective resampling chart 1"><br><br>
							<img src="images/Selective resampling chart 2.jpg" alt="Selective resampling chart 2"><br><br>
						</span>
	                </div>
    			</div>
    		</div>

            <label class="control-label" for="sox_quality">质量</label>
            <div class="controls">
                <select id="sox_quality" name="conf[sox_quality]" class="config-select-large">
					$_mpd_select[sox_quality]
                </select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info_sox_quality" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info_sox_quality" class="config-help-info config-help-no-margin">
					<b>Very high: </b>Precision 28, Phase response 50 (Linear phase), Passband end 91%, Stopband begin 100%, Attenuation 0dB.<br>
					<b>High (Default): </b>Precision 20, Phase response 50 (Linear phase), Passband end 91%, Stopband_begin 100%, Attenuation 0dB.<br>
					<b>Medium: </b>Precision 16, Phase response 50 (Linear phase), Passband end 92%, Stopband begin 100%, Attenuation 0dB.<br>
					<span class="$_sox_custom_recipe_hide">
						<b>Custom recipe: </b>设置各个参数。
					</span>
				</span>
                <span class="config-help-static">
                    当“质量”设置为“Custom recipe”时，将显示单独的质量参数。
                </span>
            </div>

			<div class="$_sox_custom_recipe_hide">
				<div id="sox_custom_recipe" class="hide">
					<label class="control-label" for="sox_precision">精度</label>
	                <div class="controls">
	                    <select id="sox_precision" name="conf[sox_precision]" class="config-select-large">
							$_mpd_select[sox_precision]
	                    </select>
						<a aria-label="Help" class="config-info-toggle" data-cmd="info_sox_precision" href="#notarget"><i class="fas fa-info-circle"></i></a>
						<span id="info_sox_precision" class="config-help-info">
							默认值为20bit，对应于“高质量”设置。“极高质量”设置使用28bit。
						</span>
					</div>
	                <label class="control-label" for="sox_phase_response">相位响应</label>
	                <div class="controls">
	                    <input class="config-input-large" type="number" id="sox_phase_response" name="conf[sox_phase_response]" value="$_mpd_select[sox_phase_response]" min="0" max="50">
						<a aria-label="Help" class="config-info-toggle" data-cmd="info_sox_phase_response" href="#notarget"><i class="fas fa-info-circle"></i></a>
						<span id="info_sox_phase_response" class="help-block-configs help-block-margin3 hide">
							范围为0至50，其中0=最小相位，25=中间相位，50=线性相位。默认值为50。
	                    </span>
	                </div>
	                <label class="control-label" for="sox_passband_end">通带末端(%)</label>
	                <div class="controls">
	                    <input class="config-input-large" type="number" id="sox_passband_end" name="conf[sox_passband_end]" value="$_mpd_select[sox_passband_end]" min="80" max="100" step="0.1">
						<a aria-label="Help" class="config-info-toggle" data-cmd="info_sox_passband_end" href="#notarget"><i class="fas fa-info-circle"></i></a>
						<span id="info_sox_passband_end" class="help-block-configs help-block-margin3 hide">
							使用的源的原始带宽。范围为80到100%，其中100%表示奈奎斯特频率。默认值为95%。
	                    </span>
	                </div>
	                <label class="control-label" for="sox_stopband_begin">阻带开始(%)</label>
	                <div class="controls">
	                    <input class="config-input-large" type="number" id="sox_stopband_begin" name="conf[sox_stopband_begin]" value="$_mpd_select[sox_stopband_begin]" min="100" max="200" step="0.1">
						<a aria-label="Help" class="config-info-toggle" data-cmd="info_sox_stopband_begin" href="#notarget"><i class="fas fa-info-circle"></i></a>
						<span id="info_sox_stopband_begin" class="help-block-configs help-block-margin3 hide">
							大于或等于100的百分比。默认值为100%，代表奈奎斯特频率。
	                    </span>
	                </div>
	                <label class="control-label" for="sox_attenuation">衰减(dB)</label>
	                <div class="controls">
	                    <input class="config-input-large" type="number" id="sox_attenuation" name="conf[sox_attenuation]" value="$_mpd_select[sox_attenuation]" min="0" max="24" step="0.1">
						<a aria-label="Help" class="config-info-toggle" data-cmd="info_sox_attenuation" href="#notarget"><i class="fas fa-info-circle"></i></a>
						<span id="info_sox_attenuation" class="help-block-configs help-block-margin3 hide">
							降低源的振幅以防止削波。范围是0到24dB。默认值为0dB。
	                    </span>
	                </div>
	                <label class="control-label" for="sox_flags">标志位</label>
	                <div class="controls">
						<input class="config-input-large" type="number" id="sox_flags" name="conf[sox_flags]" value="$_mpd_select[sox_flags]">
						<a aria-label="Help" class="config-info-toggle" data-cmd="info_sox_flags" href="#notarget"><i class="fas fa-info-circle"></i></a>
						<span id="info_sox_flags" class="help-block-configs help-block-margin3 hide">
							Bit mask for setting special SoX options.<br>
							00 ROLLOFF_SMALL 0.01 dB<br>
							01 ROLLOFF_MEDIUM 0.35 dB<br>
							02 ROLLOFF_NONE For Chebyshev bandwidth.<br>
							08 HI_PREC_CLOCK Increase "irrational" ratio accuracy.<br>
							16 DOUBLE_PRECISION Use DP calcs even if precision &lt;= 20<br>
							32 SOXR_VR Variable-rate resampling.
	                    </span>
	                </div>
				</div>
			</div>

            <label class="control-label" for="sox-multithreading">多线程操作</label>
            <div class="controls">
                <select id="sox-multithreading" name="conf[sox_multithreading]" class="config-select-large">
					$_mpd_select[sox_multithreading]
                </select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-sox-multithreading" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-sox-multithreading" class="config-help-info">
                    在多线程中运行SoX以提高效率。<br>
				</span>
            </div>

            <div class="config-horiz-rule">增益和标准化</div>

            <label class="control-label" for="replaygain">重放增益</label>
            <div class="controls">
				<select id="replaygain" name="conf[replaygain]" class="config-select-large">
					$_mpd_select[replaygain]
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-replaygain" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-replaygain" class="config-help-info">
					使用重放增益标签调整播放歌曲的音量。将此设置为“专辑”将使用专辑的重放增益标签调整音量，而设置为“曲目”将使用曲目重放增益标签调整音量。如果MPD随机播放被激活，设置为“自动”将使用曲目重放增益标签，否则将使用专辑重放增益标签。目前只支持FLAC、Ogg Vorbis、Musepack、MP3(通过ID3v2 ReplayGain标签，不支持APEv2)。
               </span>
            </div>

            <label class="control-label" for="replaygain-preamp">重放增益前置放大器</label>
            <div class="controls">
                <input class="config-input-large" type="number" id="replaygain-preamp" name="conf[replaygain_preamp]" value="$_mpd_select[replaygain_preamp]" min="-15" max="15">
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-replaygain-preamp" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-replaygain-preamp" class="config-help-info">
					应用于带有重放增益标签的歌曲的增益(dB)。范围是-15到15。
                </span>
            </div>

            <label class="control-label" for="volume-normalization">正常化音量</label>
            <div class="controls">
				<select id="volume-normalization" name="conf[volume_normalization]" class="config-select-large">
					$_mpd_select[volume_normalization]
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-volume-normalization" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-volume-normalization" class="config-help-info">
					播放歌曲时调节音量，使它们听起来音量相等。
					请注意，输出位深度将被转换为16位。
				</span>
            </div>

            <div class="config-horiz-rule">资源分配</div>

            <label class="control-label" for="audio-buffer-size">音频缓冲器(MB)</label>
            <div class="controls">
                <input class="config-input-large" type="number" id="audio-buffer-size" name="conf[audio_buffer_size]" value="$_mpd_select[audio_buffer_size]" min="4" max="64">
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-audio-buffer-size" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-audio-buffer-size" class="config-help-info">
                	音频样本的缓冲区大小。范围为4到64MB。默认大小为4MB。
                </span>
            </div>

			<label class="control-label" for="max_output_buffer_size">输出缓冲器(MB)</label>
            <div class="controls">
                <input class="config-input-large" type="number" id="max_output_buffer_size" name="conf[max_output_buffer_size]" value="$_mpd_select[max_output_buffer_size]" min="8" max="512">
				<a aria-label="Help" class="config-info-toggle" data-cmd="info_max_output_buffer_size" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info_max_output_buffer_size" class="config-help-info">
                	命令输出的缓冲区大小。范围是8到512MB。默认值为128MB。
                </span>
            </div>

			<label class="control-label" for="max_playlist_length">最大队列项目数</label>
            <div class="controls">
                <input class="config-input-large" type="number" id="max_playlist_length" name="conf[max_playlist_length]" value="$_mpd_select[max_playlist_length]" min="2" max="32768">
				<a aria-label="Help" class="config-info-toggle" data-cmd="info_max_playlist_length" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info_max_playlist_length" class="config-help-info">
                	范围是2到32768个队列项目。默认为16384项。
                </span>
            </div>

			<label class="control-label" for="input_cache">输入缓存</label>
			<div class="controls">
				<select id="input_cache" name="conf[input_cache]" class="config-select-large">
					$_mpd_select[input_cache]
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-input-cache" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-input-cache" class="config-help-info">
					输入缓存在播放之前将排队的歌曲文件预取到内存中。如果缓存增长超过指定的大小，旧文件将被逐出。
			   </span>
			</div>

            <div class="config-horiz-rule">其他选项</div>

            <label class="control-label" for="log_level">日志级别</label>
            <div class="controls">
				<select id="log_level" name="conf[log_level]" class="config-select-large">
					$_mpd_select[log_level]
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-log_level" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-log_level" class="config-help-info">
					控制MPD日志(/var/log/mpd/log)中的详细程度。
               </span>
            </div>

            <!-- DEPRECATE -->
            <!--label class="control-label" for="buffer-time">Hardware buffer time</label>
            <div class="controls">
				<select id="buffer-time" name="conf[buffer_time]" class="config-select-large">
					$_mpd_select[buffer_time]
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-buffer-time" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-buffer-time" class="config-help-info">
					This sets the length of the hardware sample buffer in microseconds.  Increasing	it may help to reduce or eliminate skipping on certain setups. Most users do not need to change this. The default is 500000 microseconds (0.5 seconds).
				</span>
            </div>

            <label class="control-label" for="period-time">Hardware period time</label>
            <div class="controls">
				<select id="period-time" name="conf[period_time]" class="config-select-large">
					$_mpd_select[period_time]
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-period-time" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-period-time" class="config-help-info">
					This sets the time between hardware sample transfers in microseconds. Increasing this can reduce CPU usage while lowering it can reduce underrun errors on bandwidth-limited devices. Some users have reported good results with this set to 50000, but not all devices support values this high. Most users do not need to change this. The default is 256000000 / sample_rate(kHz), or 5804 microseconds for CD-quality audio.
				</span>
            </div>

			<legend>ALSA auto-conversion</legend>
            <label class="control-label" for="auto-resample">ALSA auto-resample</label>
            <div class="controls">
				<select id="auto-resample" name="conf[auto_resample]" class="config-select-large">
					$_mpd_select[auto_resample]
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-auto-resample" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-auto-resample" class="config-help-info">
					Setting this to "No" disables ALSA's software resampling. NOTE: This lets MPD do the resampling if the hardware does not support the required sample rate. Default: "Yes".
				</span>
            </div>

            <label class="control-label" for="auto-channels">ALSA auto-channels</label>
            <div class="controls">
				<select id="auto-channels" name="conf[auto_channels]" class="config-select-large">
					$_mpd_select[auto_channels]
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-auto-channels" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-auto-channels" class="config-help-info">
					Setting this to "No disables ALSA's channel conversion. WARNING: If set to "No" and the hardware does not support the required number of channels MPD will fail to open the audio output. Default: "Yes".
				</span>
            </div>

            <label class="control-label" for="auto-format">ALSA auto-format</label>
            <div class="controls">
				<select id="auto-format" name="conf[auto_format]" class="config-select-large">
					$_mpd_select[auto_format]
				</select>
				<a aria-label="Help" class="config-info-toggle" data-cmd="info-auto-format" href="#notarget"><i class="fas fa-info-circle"></i></a>
				<span id="info-auto-format" class="config-help-info">
					Setting this to "No" disables ALSA's sample format conversion. WARNING: If set to "No" and the hardware does not support the required sample format MPD will fail to open the audio output. Default: "Yes".
				</span>
				<span class="help-block-configs help-block-margin">
                    WARNING: Setting this to "No" is not compatible with Crossfeed, Parametric EQ or Graphic EQ.
				</span>
            </div-->
        </div>
    </form>
</div>
</div>
